/**
 * 
 */
package org.mspring.mlog.web.module.web.ucenter.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.mspring.mlog.entity.security.User;
import org.mspring.mlog.service.security.UserService;
import org.mspring.mlog.support.resolver.SpaceUser;
import org.mspring.mlog.web.module.web.ucenter.AbstractUCenterWidget;
import org.mspring.platform.web.freemarker.widget.stereotype.Widget;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Gao Youbo
 * @since 2013-6-10
 * @Description
 * @TODO
 */
@Widget
@RequestMapping("/u/{username}/admin")
public class UCenterAdmin_IndexWidget extends AbstractUCenterWidget {
    @Autowired
    private UserService userService;

    @RequestMapping({ "/", "" })
    public String index(@SpaceUser(pathVariable = "username") User user, HttpServletRequest request, HttpServletResponse response, Model model) {
        if (user == null) {
            return "skin:/errors/404";
        }
        return "skin:/ucenter/admin/index";
    }

}
